package com.example.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.dto.KeepPlanDto;
import com.example.entity.dto.KeepPlanPageDto;
import com.example.entity.matirx.KeepPlan;
import com.example.mapper.KeepPlanMapper;
import com.example.service.KeepPlanService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class KeepPlanServiceImpl extends ServiceImpl<KeepPlanMapper, KeepPlan> implements KeepPlanService {
    @Autowired
    private KeepPlanMapper keepPlanMapper;

    @Override
    public Page pageWithContent(KeepPlanPageDto planPageDto) {
        PageHelper.startPage(planPageDto.getPage(),planPageDto.getPageSize());
        Page<KeepPlanDto> keepPlanDtos = keepPlanMapper.pageWithContent(planPageDto.getPlanName());
        return keepPlanDtos;
    }

    @Override
    public List<KeepPlan> listuse() {
        return keepPlanMapper.listuse(1);
    }
}
